#define _CRT_SECURE_NO_WARNINGS 1
//#include<iostream>
//#include<cstring>
//using namespace std;
//int k;
//string str1;
//void dfs() {
//    if (str1[k] == '#')
//    {
//        k++;
//        return;
//    }
//    char r = str1[k++];
//    dfs();
//    cout << str1[k];
//    dfs();
//}
//int main()
//{
//    cin >> str1;
//    dfs();
//    return 0;
//}
#include<iostream>
#include<vector>
using namespace std;
bool cmp(vector<int> a, vector<int> b) {
    if (a.size() > b.size()) return true;
    else if (b.size() > a.size()) return false;
    else
    {
        int i = 0;
        while (a[i] == b[i]) {
            i++;
        }
        if (a[i] > b[i])
            return true;
        return false;
    }
}
vector<int> sub(vector<int>& a, vector<int>& b) {
    if (!cmp(a, b))
        return sub(b, a);
    vector<int> c;
    int t = 0;
    for (int i = 0; i < a.size(); i++)
    {
        t += a[i] - b[i];
        c.push_back((t + 10) % 10);
        t /= 10;
    }
    while (c.size() > 1 && c.back() == 0)
        c.pop_back();
    return c;
}
int main()
{
    string s1, s2;
    cin >> s1 >> s2;
    vector<int> a, b;
    for (int i = s1.size() - 1; i >= 0; i--)
        a.push_back(s1[i]);
    for (int i = s2.size() - 1; i >= 0; i--)
        b.push_back(s2[i]);
    if (!cmp(a, b))
        printf("-");
    auto c = sub(a, b);
    for (int i = c.size() - 1; i >= 0; i--)
        printf("%d", c[i]);
    return 0;
}